<?php
if (!function_exists('getallheaders')) {
    function getallheaders()
    {
        $headers = array();
        foreach ($_SERVER as $name => $value) {
            if (substr($name, 0, 5) == 'HTTP_') {
                $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
            }
        }
        return $headers;
    }
}


function cutword($string, $start_code, $end_code){
    $start_pos = strpos($string, $start_code);
    $start_string = substr($string, $start_pos+strlen($start_code));

    $end_pos = strpos($start_string, $end_code);

    $end_string =  substr($start_string, 0, $end_pos);
    return $end_string;
}